package leecode;

import org.junit.Test;

public class Question190 {

    public int reverseBits(int n) {
        int rev = 0;
        for (int i = 0; i < 32 && n != 0; ++i) {
            rev |= (n & 1) << (31 - i);
            n >>>= 1;
        }
        return rev;
    }
    @Test
    public void main(){
        System.out.println(reverseBits(213123123));
        System.out.println(Integer.reverse(213123123));
        System.out.println(Integer.toBinaryString(213123123));
    }



}
